class UsersController < ApplicationController
  # render new.rhtml
  def new
    @user = User.new

    respond_to do |format|
      format.html # new.html.erb
    end
  end
  def edit
  end
  
  def create
    cookies.delete :auth_token
    # protects against session fixation attacks, wreaks havoc with 
    # request forgery protection.
    # uncomment at your own risk
    # reset_session
    @user = User.new(params[:user])
    @user.save
    	if @user.errors.empty?
      		self.current_user = @user
      		redirect_back_or_default('/')
      		flash[:notice] = "Thanks for signing up!"
    	else
      		render :action => 'new'
    	end
  end

end
